<?php 
defined( '_VALID_NVB' ) or die( 'Direct Access to this location is not allowed.' );
$tpl = new TemplatePower("template/search.htm");
$tpl->prepare();
	$tpl->assignGlobal("site_address",$site_address);
	$keyword=clean_value($_REQUEST['keyword']);
	//$sql="SELECT * FROM news".$lang." WHERE active=1  ORDER BY thu_tu DESC, id_news DESC";
	$sql="SELECT *, match(name, intro, content) against('$keyword' in boolean mode) as relevance FROM news".$lang." WHERE match(name, intro, content) against('$keyword' in boolean mode)  ORDER BY relevance ASC";
		$db=phan_trang_rewrite($_GET['p'],$site_address.Get_Main_Cat_Name($idc).'_'.$idc,$sql,8,14);
		while($rs=mysql_fetch_array($db['db'])){
			$tpl->newBlock("list_item");
			$tpl->assign("name",$rs['name']);
			$tpl->assign("intro",$rs['intro']);
			if ($rs['small_image']){
				$tpl->assign("image","<img  src='".$site_address.$CONFIG['upload_image_path'].$rs['small_image']."' align='left'  border='0' class='image' >");
			}	
			
			
				$tpl->assign("link_detail",$site_address.Get_Main_Cat_Name($rs['id_cat']).clean_url($rs['name']).'_'.$rs['id_cat'].'_'.$rs['id_news']."_".$idmenu.'.newsd');
			
		}
	//	$tpl->assign("_ROOT.pages",$db['cac_trang']);


$tpl->printToScreen();	
?>